<?php
	$rs= $db->Query("select * from presu_hardware where id_presu='".$_GET["numero"]."'");
	$fila= $db->QuerySingleRow("select * from totales where total_id_presu='".$_GET["numero"]."'");
 ?>
<div id="hardware">
<h3>- HARDWARE -</h3>
<input type="button" name="addrow" value="A&ntilde;adir Hardware"
        onclick="addItem();" />
<table id="items">
        <tr>
                <th>Tipo</th>
                <th>Modelo</th>
                <th>Cantidad</th>
                <th>Importe</th>
                <th>Total</th>
                <th>Borrar</th>
        </tr>
	<?php
		$cont_items=200;
		while($row=mysql_fetch_array($rs)){
			echo'<tr id="hdwrow'.$cont_items.'">
				<td><input type="text" class="inputhtipo" name="htipo'.$cont_items.'" value="'.$row["tipo"].'"/></td>
				<td><input type="text" class="inputmodelo" name="hmodelo'.$cont_items.'" value="'.$row["modelo"].'"/></td>
				<td><input type="text" id="hcant'.$cont_items.'" class="hsumar cantidad" name="hcnt'.$cont_items.'" value="'.$row["cantidad"].'"/></td><td><input type="text" id="hprecio'.$cont_items.'" class="hsumar precio" name="hpre'.$cont_items.'" value="'.$row["precio"].'"/>&#8364;</td><td><input type="text" class="hsumar" id="hptt'.$cont_items.'" name="hptt'.$cont_items.'" readonly value="'.$row["total"].'"/>&#8364;</td><td><img class="deleterow" id="delrow'.$cont_items.'" src="img/delete.gif" alt="borrar"/></td>
			</tr>';
		$cont_items++;
		}
	 ?>
</table>
<p>Total Hardware: <input type="text" id="hdwtotal" name="hdwtotal" value="<?php echo $fila->total_hdw;?>"
        value="0" readonly />&#8364;</p>
</div>

